#include "stdio.h"
#include "soc_check.h"

#define FALSE	0
#define	TRUE	1
#define	LEN	10

int  soc_version_check(char **soc_name)
{
    int ret;
    FILE *soc_fd;
    char name[LEN];
    char **list = soc_name;

    soc_fd = fopen("/sys/devices/soc0/soc_id", "r");
    if (soc_fd == NULL)
        return FALSE;
    ret = fread(name, 1, LEN, soc_fd);
    fclose(soc_fd);

    if (ret <= 0)
        return FALSE;

    name[ret-1] = '\0';
    while (**list != ' ') {
        if (!strcmp(name, *list))
            goto out;
        else
            list++;
    }

out:
    if (**list != ' ')
        return TRUE;
    else
        return FALSE;
}
